chore(miner): migrate batch 4.4 foundational lib modules to TypeScript - #7383
Conversation
Converts ams-policy, rejection-templates, calibration-types, opportunity-fanout, discovery-index-client, contribution-profile-cache, plan-store, and attempt-runner from hand-maintained .js/.d.ts pairs to real .ts source, compiled in place via the package's existing tsc build pipeline. Extends targeted unit tests to drive every converted file to 100% statement/branch/function/line coverage.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…ed opportunity-fanout.js tsc's printer left a trailing space at the end of the fetchWithRetry(...) call's first line when an inline comment sat between two of its arguments in the .ts source -- caught by CI's git diff --check gate. Hoists the comment above the call and extracts the options object into a named retryOptions variable instead; no behavior change.
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-19 23:54:50 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7383 +/- ##
==========================================
+ Coverage 91.13% 91.15% +0.02%
==========================================
Files 715 715
Lines 72579 72648 +69
Branches 20166 20360 +194
==========================================
+ Hits 66143 66225 +82
+ Misses 5394 5381 -13
Partials 1042 1042
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Closes #7312
Summary
Part of the phased
packages/loopover-miner/lib/**TypeScript migration (parent #7290, Phase 1 #7299 merged). This is batch 4.4 of 8 (Phase 4): converts these 8 files from hand-maintained.js/.d.tspairs to real, compiler-verified.tssource, compiled in place via the package's existing tsc build pipeline (same in-place-emit pattern Phase 1 wired up):lib/ams-policy.jslib/rejection-templates.jslib/calibration-types.jslib/opportunity-fanout.jslib/discovery-index-client.jslib/contribution-profile-cache.jslib/plan-store.jslib/attempt-runner.jsNo
tsconfig.jsonchanges needed (the existingbin/**/*.ts, lib/**/*.tsinclude glob picks up the newly-converted files automatically). No behavior change — existing tests continue to pass unmodified; a small number of test-only additions extend coverage of pre-existing defensive branches that the migration's stricter compiled type-checking newly surfaced as reachable-but-untested.Scope checklist
.jsto.ts.d.tssibling removed (tsc regenerates it, committed alongside the.tssource).js/.d.tsbuild output regenerated and committedTest plan
npm run typecheck(root) — cleannpm run build --workspace @loopover/engine && npm run build --workspace @loopover/miner— clean,node --checkpasses for all 121 filescoverage-summary.json, not just the terminal table)npm run actionlint,db:schema-drift:check,selfhost:env-reference:check,miner:env-reference:check,docs:drift-check,branding-drift:check,manifest:drift-check,engine-parity:drift-check,release-manifest:sync:check,command-reference:check— all cleannpm run test:mcp-pack,npm run test:miner-pack,npm run test:miner-deployment-docs-audit— all clean, converted files'.js/.d.tspresent in the packed file listnpx vitest run --config vitest.workers.config.ts— cleannpm run ui:openapi:check,npm run ui:typecheck,npm run ui:lint— clean (one cross-package type error caught byui:typecheck's stricterexactOptionalPropertyTypesconfig, not caught by the roottypecheck, was fixed)npm audit— 2 pre-existing high-severity advisories ingithub-actionlint'sadm-zipdependency (no fix available), unrelated to this diffupstream/mainimmediately before pushing